/*
https://leetcode-cn.com/problems/clumsy-factorial/solution/ben-jie-cheng-by-leetcode-solution-deh2/
 */
public class Solution1006 {
    public int clumsy(int n) {
        switch (n){
            case 1:return 1;
            case 2:return 2;
            case 3:return 6;
            case 4:return 7;
            default:
                switch (n%4){
                    case 0:return n+1;
                    case 1:
                    case 2:
                        return n+2;
                    case 3:return n-1;
                }
        }
        return 0;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1006().clumsy(10));
    }
}
